package com.xb.p4_widgets;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.view.View;
import android.widget.Switch;
import android.widget.TextView;
import android.widget.ToggleButton;

public class ButtonStyleActivity extends AppCompatActivity {

    TextView textView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_button_style);
        textView=findViewById(R.id.tv_btn);
    }


    public void show_message_tooggle(View view){
        if( ((ToggleButton)view).isChecked() ){
            textView.setText("ToggleButton is ON");
        }else{
            textView.setText("ToggleButton is OFF");
        }
    }

    public void show_message_switch(View view){
        if( ((Switch)view).isChecked() ){
            textView.setText("Switch is ON");
        }else{
            textView.setText("Switch is OFF");
        }
    }
}
